﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.EntityFrameworkCore;

namespace ESTAR.Infrastructure
{
    public class QueryServicesCore<T> where T : BaseModel
    {
        /// <summary>
        /// 主库
        /// </summary>
        protected readonly DbSet<T> _entities;


        public QueryServicesCore(DbContext context)
        {
            _entities = context.Set<T>();
        }


        public IQueryable<T> Query()
        {
            return _entities.AsTracking();
        }
        public IQueryable<T> QueryNoTracking()
        {
            return _entities.AsNoTracking();
        }
    }
}
